//
//  UIView+BKKit.m
//  XPhoto
//
//  Created by sentinel on 2020/4/20.
//  Copyright © 2020 baboy. All rights reserved.
//

#import "UIView+BKKit.h"

@implementation UIView(BKKit)
- (NSLayoutConstraint *)constraintForAttribute:(NSLayoutAttribute) attribute firstItem:(UIView *)firstItem secondItem:(UIView * _Nullable)secondItem{
    for (NSLayoutConstraint * constraint in self.constraints) {
        if (constraint.firstItem == firstItem && constraint.secondItem == secondItem && constraint.firstAttribute == attribute) {
            return constraint;
        }
    }
    return  nil;
}
@end
